<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="userinfo">
	<div class="userinfo" style="background: url(http://www.gravatar.com/avatar/{mailhash}?s=60) no-repeat left center;">					
		<div class='username'><xsl:value-of select="name" disable-output-escaping="yes"/></div>				
		<div class='userroles'>
			<xsl:for-each select="roles/item">
				<xsl:value-of select="." disable-output-escaping="yes"/> 
			</xsl:for-each>
		</div>				
		<div class='exit'><a href='/Logout/'>Выйти</a></div>
	</div>
</xsl:template>

<xsl:template match="relocate">
	<script language="JavaScript">
		window.location.href = '<xsl:value-of select="." disable-output-escaping="yes"/>';
	</script>
</xsl:template>

<xsl:template match="startpage">
	<div>
		<h1><xsl:value-of select="title" disable-output-escaping="yes"/></h1>
		
		<div class="mainmenu">
			<xsl:for-each select="menu/item">
				<div class="mainmenuitem">
					<div style="background: url({icon}) no-repeat right center;">
						<a href="{link}" class="mainmenutitle"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
					</div>
					<div class="mainmenusubtitle"><xsl:value-of select="subtitle" disable-output-escaping="yes"/></div>
					<xsl:if test="count(load) > 0">
						<xsl:for-each select="load">
							<div id="{@id}" class="startload"></div>				
							<script language="JavaScript">
								startLoad('<xsl:value-of select="@id"/>', '<xsl:value-of select="@url"/>');
							</script>
						</xsl:for-each>
					</xsl:if>
				</div>
			</xsl:for-each>
			<xsl:if test="count(utils/item)">
				<div class="mainmenuitem">
					<h2>Дополнительные возможности</h2>
					<xsl:for-each select="utils/item">
						<div class="utilitem" style="background: url({icon}) no-repeat left center;">
							<a href="{link}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
						</div>
					</xsl:for-each>							
				</div>
			</xsl:if>
		</div>		
		
		
	</div>
</xsl:template>

<xsl:template match="userinfo" mode="ajax">
</xsl:template>

<xsl:template match="nop" mode="ajax">
	NOP
</xsl:template>

</xsl:stylesheet>
